package com.hz.eduService.mapper;

import com.hz.eduService.domain.UserCourse;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
* @author li
* @description 针对表【user_courses(学生选课表)】的数据库操作Mapper
* @createDate 2023-09-23 17:14:13
* @Entity com.hz.eduService.domain.UserCourse
*/
public interface UserCourseMapper extends BaseMapper<UserCourse> {
    @Select("SELECT * from  user_courses where student_user_id =#{userId} and course_id = #{courseId}")
    UserCourse selectByUserIdAndCourseId(@Param("userId") Integer userId,@Param("courseId") Integer courseId);

    @Update(" UPDATE user_courses SET cancel_course=0 WHERE id=#{id} AND cancel_course=1")
    Integer updateCancelCourse(@Param("id") Integer id);
}




